Skip to content

Expire quiet agents from the MCP presence list - #4

Merged
rafiki270 merged 1 commit into
mainfrom
fix/agent-presence-lease
Nov 21, 2026
Merged

rafiki270 merged 1 commit into
mainfrom
fix/agent-presence-lease

Conversation

@rafiki270

Copy link
Copy Markdown
Contributor

Agents now leave the Electroscope window and the /health count after three minutes without a session request. Sending a ping once a minute keeps a waiting agent visible. A later tool call or ping restores the agent under its existing session ID during the 30-minute session retention period.

The window still shows a quiet agent as idle after 90 seconds. Explicit disconnects remove it immediately, and a closed event stream has ten seconds to reconnect.

Discussion on r/mcp

Windows desktop

The same POST-only client, three minutes after its last request.

Before After
Bench agent still listed as idle Bench agent removed from the roster

Testing

Windows 11 on Minis, Node 24. Typecheck, 58 tests, the build, and all 27 synthetic-camera end-to-end checks passed. Checked expiry and renewal over HTTP for clients with and without an event stream. In the desktop app, a POST-only client went idle, disappeared, returned on a ping with the original session ID, and left immediately on DELETE.

@rafiki270
rafiki270 merged commit 2a75a17 into main Nov 21, 2026
1 check passed
@rafiki270
rafiki270 deleted the fix/agent-presence-lease branch November 21, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant